﻿using EntityFramework.Entity.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YouTravel.DomainModels;

namespace Repositories.Configuration
{
    public class SellerSupplierMap : EntityConfigurationBase<SellerSupplier>
    {
        public SellerSupplierMap()
        {
            this.Property(p => p.Name).HasMaxLength(50).IsRequired();
            this.Property(p => p.Phone).HasMaxLength(11).IsRequired();
            this.Property(p => p.Bank).HasMaxLength(30).IsRequired();
            this.Property(p => p.CertificateNum).HasMaxLength(18).IsRequired();
            this.Property(p => p.ChargeBankNumber).HasMaxLength(20).IsRequired();
            this.Property(p => p.ChargeName).HasMaxLength(20).IsRequired();
            this.Property(p => p.UpdaterName).HasMaxLength(20);

            this.HasRequired(p => p.Creater).WithMany().HasForeignKey(f => f.CreaterId);
            this.HasRequired(p => p.Updater).WithMany().HasForeignKey(f => f.UpdaterId);
        }
    }
}
